package tech.threekilogram.contenttransitiontest;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v7.app.AppCompatActivity;
import android.transition.Explode;

/**
 * @author liujin
 */
public class ExplodeActivity extends AppCompatActivity {

      public static void start ( Context context ) {

            Intent starter = new Intent( context, ExplodeActivity.class );
            context.startActivity(
                starter,
                ActivityOptionsCompat.makeSceneTransitionAnimation( (Activity) context ).toBundle()
            );
      }

      @Override
      protected void onCreate ( Bundle savedInstanceState ) {

            super.onCreate( savedInstanceState );
            setContentView( R.layout.activity_explod );

            getWindow().setEnterTransition( new Explode().setDuration( 1000 ) );
            getWindow().setExitTransition( new Explode().setDuration( 1000 ) );
      }
}
